//
//  BYWebViewProgress.h
//  Unity-iPhone
//
//  Created by 胡忠诚 on 2018/4/26.
//UIWebView的进度条

#import <UIKit/UIKit.h>

#undef BY_weak
#if __has_feature(objc_arc_weak)
#define BY_weak weak
#else
#define BY_weak unsafe_unretained
#endif

extern const float BYInitialProgressValue;
extern const float BYInteractiveProgressValue;
extern const float BYFinalProgressValue;
typedef void (^BYWebViewProgressBlock)(float progress);
@protocol BYWebViewProgressDelegate;

@interface BYWebViewProgress : NSObject<UIWebViewDelegate>
@property (nonatomic, BY_weak) id<BYWebViewProgressDelegate>progressDelegate;
@property (nonatomic, BY_weak) id<UIWebViewDelegate>webViewProxyDelegate;
@property (nonatomic, copy) BYWebViewProgressBlock progressBlock;
@property (nonatomic, readonly) float progress; // 0.0..1.0

- (void)reset;

@end

@protocol BYWebViewProgressDelegate <NSObject>
- (void)webViewProgress:(BYWebViewProgress *)webViewProgress updateProgress:(float)progress;
@end
